// eslint-disable-next-line
const throttle = function (fn, interval) {
  let now = Date.now();

  // eslint-disable-next-line
  return function(...args) {
    if (Date.now() - now >= interval) {
      fn.call(this, ...args);
      now = Date.now();
    }
  };
};

export default throttle;
